package com.j283_5.wisdom_park.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.j283_5.wisdom_park.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author laoda
 * @since 2022-04-28
 */
@Mapper
public interface MaintenanceRecordMapper extends BaseMapper<MaintenanceRecord> {

    /**
     * 模糊查询运维信息
     * @param maintenance
     * @param start
     * @param limit
     * @return
     */
    List<Maintenance> queryAllMaintenance(@Param("maintenance") Maintenance maintenance,
                                          @Param("start")
                                                  Integer start,
                                          @Param("limit")
                                                  Integer limit,
                                          @Param("oneAdminId")
                                                  Integer adminId);

    /**
     * 查询所有的条数
     * @return
     */
    Integer queryMaintenanceCount(@Param("maintenance") Maintenance maintenance,
                                  @Param("oneAdminId")
                                          Integer adminId);

    /**
     * 根据id集合假删除运维信息
     * @param maintenanceIdList
     * @return
     */
    Integer deleteMaintenance(@Param("maintenanceIdList") ArrayList maintenanceIdList);

    /**
     * 根据id查询运维详细信息
     * @param mrecId
     * @return
     */
    MaintenanceDelivery queryMaintenanceDelivery(@Param("mrecId") Integer mrecId);


    /**
     * 根据运维id和管理员id来派送运维信息
     * @param mrecId
     * @param adminId
     * @return
     */
    Integer maintenanceDelivery(@Param("mrecId") Integer mrecId, @Param("adminId") Integer adminId);

    /**
     * 运维设备
     * @param maintenanceDelivery
     * @return
     */
    Integer updateMaintenanceDelivery(@Param("maintenanceDelivery") MaintenanceDelivery maintenanceDelivery);

    /**
     * 添加运维信息
     * @param maintenanceDelivery
     * @return
     */
    Integer addMaintenanceDelivery(@Param("maintenanceDelivery") MaintenanceDelivery maintenanceDelivery, @Param("wrecId") Integer wrecId);
}
